
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>svg 之 marker · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../svg文本/svg文本.html" />
    
    
    <link rel="prev" href="../svg分组与复用/svg分组与复用.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../svg基础/svg基础.html">
            
                <a href="../svg基础/svg基础.html">
            
                    
                    svg 基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../svg基本图形/svg基本图形.html">
            
                <a href="../svg基本图形/svg基本图形.html">
            
                    
                    svg 基本图形
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../svg之path/svg之path.html">
            
                <a href="../svg之path/svg之path.html">
            
                    
                    svg 之 path
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../svg描边动画/svg描边动画.html">
            
                <a href="../svg描边动画/svg描边动画.html">
            
                    
                    svg 描边动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../svg之fill及fill-rule/svg之fill及fill-rule.html">
            
                <a href="../svg之fill及fill-rule/svg之fill及fill-rule.html">
            
                    
                    svg 之 fill 及 fill-rule
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../svg之viewBox/svg之viewBox.html">
            
                <a href="../svg之viewBox/svg之viewBox.html">
            
                    
                    svg 之 viewBox
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../svg分组与复用/svg分组与复用.html">
            
                <a href="../svg分组与复用/svg分组与复用.html">
            
                    
                    svg 分组与复用
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.9" data-path="svg之marker.html">
            
                <a href="svg之marker.html">
            
                    
                    svg 之 marker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../svg文本/svg文本.html">
            
                <a href="../svg文本/svg文本.html">
            
                    
                    svg 文本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../svg之pattern/svg之pattern.html">
            
                <a href="../svg之pattern/svg之pattern.html">
            
                    
                    svg 之 pattern
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../svg之clipPath和mask/svg之clipPath和mask.html">
            
                <a href="../svg之clipPath和mask/svg之clipPath和mask.html">
            
                    
                    svg 之 clipPath 和 mask
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../svg之filter/svg之filter.html">
            
                <a href="../svg之filter/svg之filter.html">
            
                    
                    svg 之 filter
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >svg 之 marker</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="svg-&#x4E4B;-marker">svg &#x4E4B; marker</h1>
<p>&#x5982;&#x4F55;&#x4F7F;&#x7528; SVG &#x7ED8;&#x5236;&#x4E00;&#x652F; <strong>&#x5F13;&#x7BAD;</strong> ?</p>
<p><img src="imgs/arrow.svg" alt="marker"></p>
<p> &#x7ED8;&#x5236;&#x96BE;&#x70B9;&#x5728;&#x4E8E;&#x5982;&#x4F55;&#x5904;&#x7406;&#x7BAD;&#x5934;&#x548C;&#x7BAD;&#x7FBD;&#x3002;&#x8981;&#x89E3;&#x51B3;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#xFF0C;&#x5C31;&#x5F97;&#x501F;&#x52A9; <strong>marker &#x5143;&#x7D20;</strong>&#x3002;</p>
<h2 id="&#x5B9A;&#x4E49;">&#x5B9A;&#x4E49;</h2>
<p><strong>marker &#x5143;&#x7D20;</strong>&#xFF0C;&#x987E;&#x540D;&#x601D;&#x4E49;&#xFF0C;&#x7528;&#x4E8E;&#x6807;&#x8BB0; <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path" target="_blank">path</a>&#x3001;<a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/line" target="_blank">line</a>&#x3001;<a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/polyline" target="_blank">polyline</a> &#x6216; <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/polygon" target="_blank">polygon</a> &#x5143;&#x7D20;&#x7684;&#x9876;&#x70B9;&#xFF08;&#x8D77;&#x70B9;&#x3001;&#x7EC8;&#x70B9;&#x7B49;&#xFF09;&#x3002;&#x5B83;&#x662F;&#x4E00;&#x79CD;&#x5F15;&#x7528;&#x5143;&#x7D20;&#x3002;&#x5373;&#x5B9A;&#x4E49;&#x65F6;&#x4E0D;&#x4F1A;&#x663E;&#x793A;&#xFF0C;&#x5728;&#x88AB;&#x5F15;&#x7528;&#x65F6;&#x624D;&#x4F1A;&#x663E;&#x793A;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x6700;&#x597D;&#x5C06;&#x5176;&#x5B9A;&#x4E49;&#x5728; <code>&lt;defs&gt;</code> &#x6807;&#x7B7E;&#x5185;&#x3002;</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">defs</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">marker</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- &#x5B9A;&#x4E49;marker --&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">marker</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">defs</span>&gt;</span>
</code></pre>
<h2 id="&#x5C5E;&#x6027;">&#x5C5E;&#x6027;</h2>
<ul>
<li><p>id</p>
<p>&#x901A;&#x8FC7; <code>&quot;id&quot;</code> &#x6765;&#x5F15;&#x7528;&#x5BF9;&#x5E94;&#x7684; marker &#x5143;&#x7D20;</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">defs</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;arrow&quot;</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">marker</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- &#x5B9A;&#x4E49;marker --&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">marker</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">defs</span>&gt;</span>
</code></pre>
</li>
<li><p>markerWidth &#x4E0E; markerHeight</p>
<p>&#x6307;&#x5B9A; marker &#x5143;&#x7D20;&#x7684; <strong>viewport</strong> &#x7684;&#x5BBD;&#x548C;&#x9AD8;&#x3002;&#x9ED8;&#x8BA4;&#x503C; <code>markerWidth: 3</code> , <code>markerHeight: 3</code>&#x3002;</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">defs</span> &gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">marker</span> <span class="hljs-attr">markerWidth</span>=<span class="hljs-string">&quot;30&quot;</span> <span class="hljs-attr">markerHeight</span>=<span class="hljs-string">&quot;12&quot;</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- &#x5B9A;&#x4E49;marker --&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">marker</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">defs</span>&gt;</span>
</code></pre>
</li>
<li><p>refX &#x4E0E; refY</p>
<p>&#x6307;&#x5B9A; marker &#x5143;&#x7D20;&#x7684; <strong>&#x5F15;&#x7528; x&#x3001;y &#x5750;&#x6807;</strong>&#x3002;&#x7528;&#x4E8E;&#x4E0E;&#x88AB;&#x5F15;&#x7528;&#x5143;&#x7D20;&#x7684;&#x9876;&#x70B9;&#x3002;</p>
<ul>
<li>refX&#xFF1A;left|center|right &#x6216; &#x5750;&#x6807;&#x6570;&#x503C;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A; 0&#x3002;</li>
<li>refY&#xFF1A;top|center|bottom &#x6216; &#x5750;&#x6807;&#x6570;&#x503C;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A; 0&#x3002;</li>
</ul>
</li>
</ul>
<pre><code class="lang-html">  <span class="hljs-tag">&lt;<span class="hljs-name">defs</span> &gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">marker</span> <span class="hljs-attr">refX</span>=<span class="hljs-string">&quot;left&quot;</span> <span class="hljs-attr">refY</span>=<span class="hljs-string">&quot;center&quot;</span>&gt;</span>
    <span class="hljs-comment">&lt;!-- &#x5B9A;&#x4E49;marker --&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">marker</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">defs</span>&gt;</span>
</code></pre>
<p>  <img src="imgs/ref.svg" alt=""></p>
<ul>
<li><p>orient</p>
<p>&#x6307;&#x5B9A; marker &#x7684;&#x65B9;&#x5411;&#xFF0C;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A; 0&#x3002;</p>
<ul>
<li>auto&#xFF1A;&#x4EE5; X &#x8F74;&#x7684;&#x65B9;&#x5411;&#x4E3A;&#x8D77;&#x59CB;&#x65B9;&#x5411;&#xFF0C;&#x65CB;&#x8F6C;&#x5230;&#x8DEF;&#x5F84;&#x7684;&#x65B9;&#x5411;&#x4E0A;&#x3002;</li>
<li>auto-start-reverse&#xFF1A;&#x5982;&#x679C;&#x4EE5; <code>marker-start</code> &#x65B9;&#x5F0F;&#x5F15;&#x7528; marker &#x5143;&#x7D20;&#xFF0C;&#x5219;&#x65CB;&#x8F6C; 180 &#x5EA6;&#x3002; &#x5176;&#x4ED6;&#x5219;&#x4E0E; <code>auto</code> &#x4E00;&#x6837;&#x3002;</li>
<li>&#x5F27;&#x5EA6;&#xFF1A;&#x4EE5; X &#x8F74;&#x7684;&#x65B9;&#x5411;&#x4E3A;&#x8D77;&#x59CB;&#x65B9;&#x5411;&#xFF0C;&#x65CB;&#x8F6C;&#x5230;&#x6307;&#x5B9A;&#x7684;&#x5F27;&#x5EA6;&#x3002;</li>
</ul>
<p><img src="imgs/orient.svg" alt="orient"></p>
</li>
<li><p>markerUnits</p>
<p>&#x7528;&#x4E8E;&#x786E;&#x5B9A; marker &#x5750;&#x6807;&#x7CFB;&#x7EDF;&#x7684;&#x4F7F;&#x7528;&#x5355;&#x4F4D;&#x3002;&#x9ED8;&#x8BA4;&#x503C; <code>&quot;strokeWidth&quot;</code>&#x3002;</p>
<ul>
<li><p>strokeWidth&#xFF1A;&#x76F8;&#x5BF9;&#x4E8E;<code>stroke-width</code>&#x8FDB;&#x884C;&#x8BA1;&#x7B97;&#x3002;</p>
</li>
<li><p>userSpaceOnUse&#xFF1A;&#x7EDD;&#x5BF9;&#x5355;&#x4F4D;&#x3002;</p>
</li>
</ul>
<p><img src="imgs/units.svg" alt="units"></p>
</li>
<li><p>viewBox &#x4E0E; preserveAspectRatio</p>
<p>&#x5173;&#x4E8E; viewBox &#x4E0E; preserveAspectRatio &#x5DF2;&#x505A;&#x8FC7;&#x76F8;&#x5173;&#x4ECB;&#x7ECD;&#xFF0C;&#x53EF;&#x4EE5;&#x53C2;&#x8003;&#x4E4B;&#x524D;&#x6587;&#x7AE0;&#xFF1A;<a href="../svg&#x4E4B;viewBox/svg&#x4E4B;viewBox.html">svg&#x4E4B;viewBox</a>&#x3002;</p>
</li>
</ul>
<h2 id="&#x5F15;&#x7528;">&#x5F15;&#x7528;</h2>
<ul>
<li><code>marker-start=&quot;url(#marker-id)&quot;</code>&#xFF1A;&#x5F15;&#x7528; marker &#x5143;&#x7D20;&#x4E0E;&#x8DEF;&#x5F84;&#x7684;&#x8D77;&#x70B9;&#x5BF9;&#x9F50;&#x3002;</li>
<li><code>marker-mid=&quot;url(#marker-id)&quot;</code>&#xFF1A; &#x5F15;&#x7528; marker &#x5143;&#x7D20;&#x4E0E;&#x9664;&#x8D77;&#x70B9;&#x3001;&#x7EC8;&#x70B9;&#x5916;&#x7684;&#x5176;&#x4ED6;&#x9876;&#x70B9;&#x5BF9;&#x9F50;&#x3002;</li>
<li><code>marker-end=&quot;url(#marker-id)&quot;</code>&#xFF1A;&#x5F15;&#x7528; marker &#x5143;&#x7D20;&#x4E0E;&#x8DEF;&#x5F84;&#x7684;&#x7EC8;&#x70B9;&#x5BF9;&#x9F50;&#x3002;</li>
</ul>
<p><img src="imgs/use.svg" alt=""></p>
<h2 id="&#x53C2;&#x8003;&#x6587;&#x7AE0;">&#x53C2;&#x8003;&#x6587;&#x7AE0;</h2>
<ul>
<li><a href="https://vanseodesign.com/web-design/svg-markers/" target="_blank">How To Create SVG Arrowheads and Polymarkers &#x2014; The marker Element</a></li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../svg分组与复用/svg分组与复用.html" class="navigation navigation-prev " aria-label="Previous page: svg 分组与复用">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../svg文本/svg文本.html" class="navigation navigation-next " aria-label="Next page: svg 文本">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"svg 之 marker","level":"1.9","depth":1,"next":{"title":"svg 文本","level":"1.10","depth":1,"path":"svg文本/svg文本.md","ref":"./svg文本/svg文本.md","articles":[]},"previous":{"title":"svg 分组与复用","level":"1.8","depth":1,"path":"svg分组与复用/svg分组与复用.md","ref":"./svg分组与复用/svg分组与复用.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"svg之marker/svg之marker.md","mtime":"2019-10-10T08:00:49.777Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-10-21T06:03:10.264Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

